Optimal. Leaf size=112 \[ \frac {\left (a^2+2 b^2\right ) \cos ^3(e+f x)}{3 f}-\frac {\left (a^2+b^2\right ) \cos (e+f x)}{f}-\frac {a b \sin ^3(e+f x) \cos (e+f x)}{2 f}-\frac {3 a b \sin (e+f x) \cos (e+f x)}{4 f}+\frac {3 a b x}{4}-\frac {b^2 \cos ^5(e+f x)}{5 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {2789, 2635, 8, 3013, 373} \[ \frac {\left (a^2+2 b^2\right ) \cos ^3(e+f x)}{3 f}-\frac {\left (a^2+b^2\right ) \cos (e+f x)}{f}-\frac {a b \sin ^3(e+f x) \cos (e+f x)}{2 f}-\frac {3 a b \sin (e+f x) \cos (e+f x)}{4 f}+\frac {3 a b x}{4}-\frac {b^2 \cos ^5(e+f x)}{5 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 373
Rule 2635
Rule 2789
Rule 3013
Rubi steps
\begin {align*} \int \sin ^3(e+f x) (a+b \sin (e+f x))^2 \, dx &=(2 a b) \int \sin ^4(e+f x) \, dx+\int \sin ^3(e+f x) \left (a^2+b^2 \sin ^2(e+f x)\right ) \, dx\\ &=-\frac {a b \cos (e+f x) \sin ^3(e+f x)}{2 f}+\frac {1}{2} (3 a b) \int \sin ^2(e+f x) \, dx-\frac {\operatorname {Subst}\left (\int \left (1-x^2\right ) \left (a^2+b^2-b^2 x^2\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {3 a b \cos (e+f x) \sin (e+f x)}{4 f}-\frac {a b \cos (e+f x) \sin ^3(e+f x)}{2 f}+\frac {1}{4} (3 a b) \int 1 \, dx-\frac {\operatorname {Subst}\left (\int \left (a^2 \left (1+\frac {b^2}{a^2}\right )-\left (a^2+2 b^2\right ) x^2+b^2 x^4\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=\frac {3 a b x}{4}-\frac {\left (a^2+b^2\right ) \cos (e+f x)}{f}+\frac {\left (a^2+2 b^2\right ) \cos ^3(e+f x)}{3 f}-\frac {b^2 \cos ^5(e+f x)}{5 f}-\frac {3 a b \cos (e+f x) \sin (e+f x)}{4 f}-\frac {a b \cos (e+f x) \sin ^3(e+f x)}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.35, size = 91, normalized size = 0.81 \[ \frac {-30 \left (6 a^2+5 b^2\right ) \cos (e+f x)+5 \left (4 a^2+5 b^2\right ) \cos (3 (e+f x))-3 b (b \cos (5 (e+f x))-5 a (12 (e+f x)-8 \sin (2 (e+f x))+\sin (4 (e+f x))))}{240 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.49, size = 90, normalized size = 0.80 \[ -\frac {12 \, b^{2} \cos \left (f x + e\right )^{5} - 45 \, a b f x - 20 \, {\left (a^{2} + 2 \, b^{2}\right )} \cos \left (f x + e\right )^{3} + 60 \, {\left (a^{2} + b^{2}\right )} \cos \left (f x + e\right ) - 15 \, {\left (2 \, a b \cos \left (f x + e\right )^{3} - 5 \, a b \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{60 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.22, size = 128, normalized size = 1.14 \[ \frac {3}{4} \, a b x - \frac {b^{2} \cos \left (5 \, f x + 5 \, e\right )}{80 \, f} + \frac {a b \sin \left (4 \, f x + 4 \, e\right )}{16 \, f} - \frac {a b \sin \left (2 \, f x + 2 \, e\right )}{2 \, f} + \frac {{\left (4 \, a^{2} + 5 \, b^{2}\right )} \cos \left (3 \, f x + 3 \, e\right )}{48 \, f} - \frac {{\left (2 \, a^{2} + 3 \, b^{2}\right )} \cos \left (f x + e\right )}{8 \, f} - \frac {{\left (2 \, a^{2} + b^{2}\right )} \cos \left (f x + e\right )}{4 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.28, size = 95, normalized size = 0.85 \[ \frac {-\frac {b^{2} \left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{5}+2 a b \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )-\frac {a^{2} \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.72, size = 94, normalized size = 0.84 \[ \frac {80 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a^{2} + 15 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} a b - 16 \, {\left (3 \, \cos \left (f x + e\right )^{5} - 10 \, \cos \left (f x + e\right )^{3} + 15 \, \cos \left (f x + e\right )\right )} b^{2}}{240 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 10.37, size = 157, normalized size = 1.40 \[ \frac {3\,a\,b\,x}{4}-\frac {{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (\frac {20\,a^2}{3}+\frac {16\,b^2}{3}\right )+{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4\,\left (\frac {28\,a^2}{3}+\frac {32\,b^2}{3}\right )+4\,a^2\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+\frac {4\,a^2}{3}+\frac {16\,b^2}{15}+7\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3-7\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^7-\frac {3\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^9}{2}+\frac {3\,a\,b\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{2}}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+1\right )}^5} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 3.10, size = 221, normalized size = 1.97 \[ \begin {cases} - \frac {a^{2} \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a^{2} \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {3 a b x \sin ^{4}{\left (e + f x \right )}}{4} + \frac {3 a b x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{2} + \frac {3 a b x \cos ^{4}{\left (e + f x \right )}}{4} - \frac {5 a b \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{4 f} - \frac {3 a b \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{4 f} - \frac {b^{2} \sin ^{4}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {4 b^{2} \sin ^{2}{\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{3 f} - \frac {8 b^{2} \cos ^{5}{\left (e + f x \right )}}{15 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\relax (e )}\right )^{2} \sin ^{3}{\relax (e )} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________